using System;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;

public class UIGetItemWnd : MonoBehaviour
{
	public Text txtTitle;

	public Text txtDesc;

	public Image imgIcon;

	public Text txtNum;

	public Action onClickOK;

	public Action onClickClose;

	public GameObject okBtnGO;

	public AnimationTools animationTools;

	private bool _autoTriggerClick;

	public bool autoTriggerClick
	{
		get
		{
			return _autoTriggerClick;
		}
		set
		{
			_autoTriggerClick = value;
			okBtnGO.SetActive(!value);
		}
	}

	private void Start()
	{
		imgIcon.transform.parent.gameObject.SetActive(value: false);
	}

	private void Update()
	{
	}

	public void ClickOK()
	{
		if (onClickOK != null)
		{
			onClickOK();
		}
	}

	public void ClickClose()
	{
		if (onClickClose != null)
		{
			onClickClose();
		}
	}

	public void TriggerAnimationEnd()
	{
		imgIcon.transform.parent.gameObject.SetActive(value: true);
		UnityEngine.Debug.Log("get item trigger");
		if (autoTriggerClick)
		{
			ClickOK();
			StartCoroutine(AutoTrigger());
		}
	}

	private IEnumerator AutoTrigger()
	{
		yield return new WaitForSeconds(1.5f);
		animationTools.Trigger("Hide");
	}
}
